Las Reliquias de Tolti Aph

An interactive fiction by Graham Nelson (2005) - the Inform 7 source text

Home page

Contents
Previous
Next

Complete text
Section 2(d) - La acción de conjurar

Affectedness relates various people to various spells. The verb to be affected by implies the affectedness relation.[1]

Casting it at is an action applying to one spell and one visible thing. Rule for supplying a missing second noun while casting: change the second noun to the location.[2]

Understand "conjura [spell]" or "lanza [spell]" or "[spell]" as casting it at.
Understand "conjura [spell] sobre/en [something]" or "lanza [spell] sobre/en [something]" or "[spell] sobre/en [something]" or "[spell] [something]" as casting it at.

The current spell focus is an object which varies.[3] Before casting, change the current spell focus to the location.

Check casting (this is the can't cast what you don't know rule):[4]
    if the player does not know the spell understood, say "No conoces los misterios de ese hechizo." instead.

Check casting (this is the can't cast on the wrong sort of target rule):
    if the targeting of the spell understood is targeted
    begin;
        if the second noun is a room, say "Ese hechizo debe lanzarse sobre algo." instead;
    otherwise;
        if the second noun is not a room, say "Ese hechizo no puede lanzarse sobre algo." instead;
    end if.

Check casting (this is the can't cast without strength rule):
    if the strength of the player <= the strength cost of the spell understood to the player, say "Estás débil, no tienes suficientes puntos de vida." instead.

Check casting (this is the can't cast at yourself rule):
    if the player is the second noun, say "Una de las primeras lecciones en el mundo de la magia: Un mago nunca se lanzará hechizos sobre sí mismo." instead.

Check casting (this is the can't cast without required materials rule):
    let the stuff be the requirement of the spell understood;
    if the stuff is not aire
    begin;
        if the player is carrying something (called the focus) which is made of the stuff,
            change the current spell focus to the focus;
        otherwise say "Para lanzar ese hechizo, necesitas tener algo hecho con [stuff]." instead;
    end if.

Check casting (this is the can't magically attack a warded person rule):
    if the nature of the spell understood is ofensivo and the second noun is a person
    begin;
        let the intended victim be the second noun;
        if the intended victim knows magia protectora, say "Con un insolente hechizo de chispas naranja, [the intended victim] cancela tu encantamiento [italic type][spell understood][roman type]." instead;[5]
    end if.

Effect is a rulebook.[6]

The current spell outcome is a text which varies. To record outcome (eventual message - text): change the current spell outcome to eventual message.
The current spell event is a rule which varies. To record event (eventual rule - rule): change the current spell event to eventual rule.

This is the no spell event at all rule: stop.

Carry out casting:
    record outcome "pero aparentemente no ocurre nada";
    record event the no spell event at all rule;
    change the strength of the player to the strength of the player minus the strength cost of the spell understood to the player;
    increase the usage count of the spell understood by 1;
    if the usage count of the spell understood is less than 3[7]
    begin;
        award cost of the spell understood points;
        award cost of the spell understood points;
    end if;
    if the cost of the spell understood is at least 5 and the current spell focus is something, remove the current spell focus from play;
    consider the effect rulebook.

Report casting:
    say "Tras pronunciar las palabras del hechizo [italic type][spell understood][roman type], ";
    if the current spell focus is something
    begin;
        say "[the current spell focus] ";
        if the player is not holding the current spell focus, say "desaparece mientras ";
        say "proyecta ";
    otherwise;
        say "tus dedos proyectan ";
    end if;
    say emission of the spell understood;
    if the second noun is not the current spell focus
    begin;
        if the second noun is not a room, say " hacia [the second noun]";
    end if;
    say ", [current spell outcome]";
    if the player is affected by the spell understood begin;
        if duration of the spell understood is greater than 0
        begin;
            say ", y que durará por [duration of the spell understood in words] turno[s]";
            change the duration timer of the spell understood to the duration of the spell understood;
            increase the duration timer of the spell understood by 1;
        end if;
    end if;
    say ".";
    consider the current spell event.

Every turn:
    repeat through the Table of Enchantments
    begin;
        let the remaining effect be the duration timer entry;
        decrease the remaining effect by 1;
        if the remaining effect >= 0, change the duration timer entry to the remaining effect;
        if the remaining effect is 0
        begin;
            now the player is not affected by the spell entry;
            say "(El hechizo [italic type][spell entry][roman type] termina.)";
        end if;
    end repeat.[8]

Understand "xyzzy" and "plugh" as a mistake ("Nadie cree ya esas viejas historias de la infancia acerca de cavernas con palabras mágicas. La Magia es algo que requiere años y años de estudio.").

Notes

[1]. Ahora tenemos dos verbos que conectan las personas con los hechizos: podemos escribir afirmaciones tales como "Radagast knows invocar elemental", o "Harry is affected by huesos de hierro".

[2]. "Casting it at" es una acción inusual porque puede tomar dos formas, tiene una especie de versión transitiva e intransitiva: uno lanza "detectar trampa" sin ningún objetivo, pero "misil mágico" tiene que ser orientado a algo. Inform permite a las acciones tener sintaxis que tengan un nombre opcional, pero requiere que pongamos cualquier nombre perdido para que cuando la acción vaya a ser procesada nada esté ausente. Así que construimos el destino perdido de un hechizo como la localización actual: así, "detectar trampa" es realmente un hechizo lanzado en el escenario al rededor, lo cual parece ser bastante razonable. (La acción constuida dentro de Inform "listening" (escuchar) hace algo similar.)

[3]. La variable "current spell focus" (foco actual del hechizo) tipifica algo que suele ocurrir en secuencias de reglas complejas: reglas posteriores necesitan referirse a algo ya desarrollado en el curso de una regla anterior. Esto significa que el tipo de variable "let ..." no funcionará porque es demasiado temporal - expira cuando la regla anterior termina, así que ya no estará cuando la regla posterior se alcance. Esto puede ser problemático si una acción de conjurar puede ser interrupida por alguien, pero aquí esto nunca pasa.

[4]. Nombramos estas reglas para que el autor de un escenario W&W pueda usar reglas procedurales para suspenderlas o alterarlas según necesite.

[5]. La "can't magically attack a warded person rule" es un poco torpe, ya que no reduce la fuerza mágica de la víctima al lanzar el hechizo, el cual - si es salsa para el hechicero, es salsa para el necromántico - quizás debería, pero así se queda.

[6]. Las reglas de "carry out" y "report" de la acción casting vas a ser sorpresivamente cortas - considerando el ámplio rango de resultados posibles cuando un hechizo es lanzado - y esto es posible usando un mecanismo más poderoso para permitir una forma de reportar más flexible de lo que ordinariamente sería posible: estas crean un nuevo libro de reglas, "Effect" (efecto), cuya tarea es desarrollar el hechizo. Las reglas de efecto además deben traducir el "current spell outcome" (resultado actual de un hechizo) a un mensage apropiado sobre qué está pasando, y (opcionalmente) "current spell event" (evento actual del hechizo) a una regla que acarrea ulteriores consecuencias.

[7]. Ganas puntos de experiencia las primeras veces que lanzas un hechizo, pero entonces la novedad desaparece.

[8]. Por simplicidad, y para mantener los requerimientos de almacenamiento fuera de los límites del tejado, los hechizos temporales sólo se aplican al jugador.